import type {ReactNode} from "react";

interface iRender {(): ReactNode}

interface iSetupRenderProcessor {
    (prevSetupRender: iRender): iRender
}

/**
 * 全局处理setup最终返回的render函数
 * @author  韦胜健
 * @date    2022/2/17 20:21
 */
export const processSetupRender = (() => {
    let processor: iSetupRenderProcessor | null = null
    const set = (fn: iSetupRenderProcessor) => {processor = fn}
    const get = () => processor
    return Object.assign(set, {get})
})()
